﻿using System.Collections.Generic;
using System.Linq;
using BUS;

/// <summary>
/// Summary description for CloudProducts
/// </summary>
public class CloudProducts
{
    public string Product { get; set; }
    public int Weight { get; set; }
    public string HrefUrl { get; set; }

    public CloudProducts()
    {

    }

    public static List<CloudProducts> GetList()
    {
        List<SanPhamBUS> listPros = SanPhamBUS.GetAll();

        var list = from p in listPros
                   select new CloudProducts()
                              {
                                  Product = p.TenSanPham,
                                  Weight = 10 + p.LoaiSanPham.ID,
                                  HrefUrl = "ProductDetails.aspx?id=" + p.ID
                              };
        return list.ToList<CloudProducts>();
    }
}
